/***************************************************
  Defs.h
	
****************************************************/

#ifndef _defs_
#define _defs_

#define byte unsigned char
#define word short int
#define dword int

/* Flags para derechos de acceso de los segmentos */
#define ACS_PRESENT     0x80            /* segmento presente en memoria */
#define ACS_CSEG        0x18            /* segmento de codigo */
#define ACS_DSEG        0x10            /* segmento de datos */
#define ACS_READ        0x02            /* segmento de lectura */
#define ACS_WRITE       0x02            /* segmento de escritura */
#define ACS_IDT         ACS_DSEG
#define ACS_INT_386 	0x0E		/* Interrupt GATE 32 bits */
#define ACS_INT         ( ACS_PRESENT | ACS_INT_386 )
#define ACS_EXC_386	0x0F
#define ACS_EXC		 ( ACS_PRESENT | ACS_EXC_386 )

#define ACS_CODE        (ACS_PRESENT | ACS_CSEG | ACS_READ)
#define ACS_DATA        (ACS_PRESENT | ACS_DSEG | ACS_WRITE)
#define ACS_STACK       (ACS_PRESENT | ACS_DSEG | ACS_WRITE)

#pragma pack (1) 	/* Alinear las siguiente estructuras a 1 byte */
#define screen_H 25
#define screen_W 80

#define BUFSIZE		100	/*tamanio de buffer para ungetch*/

/* Descriptor de segmento */
typedef struct {
  word limit,
       base_l;
  byte base_m,
       access,
       attribs,
       base_h;
} DESCR_SEG;


/* Descriptor de interrupcion */
typedef struct {
  word      offset_l,
            selector;
  byte      cero,
            access;
  word	    offset_h;
} DESCR_INT;

/* IDTR  */
typedef struct {
  word  limit;
  dword base;
} IDTR;

typedef	 IDTR GDTR ;

/* Bufer de datos generico*/
typedef struct buf{
	      char * buf;
	      int offset;
	      int siguiente;
	      int size;
}buf;

/* Bufer de datos generico*/
typedef struct my_shell{
	      char * buf;
	      buf comando_actual;
	      int offset;
	      int siguiente;
	      int size;
}my_shell;

typedef struct {
  unsigned int	dirBase,
		limite;
  int	E,
	A,
	G,
	C;
}STANDARTGDT;

#define NULL 0
#define MAXFILES 10
#endif

#define AYUDA		1
#define INTTIMERTICK	2
#define ECHO		3
#define INTTIMERTICKEND	4
#define COMAND_ERROR	-1

#define TIMER_ACCEL 0x2000


